<template>
	<slot v-if="isCreated"></slot>
</template>

<script lang="ts" setup>
import { computed } from "vue";
import { useStore } from "@/store";

const props = withDefaults(
	defineProps<{
		value?: string[];
	}>(),
	{
		value: () => [],
	},
);
const store = useStore();
const isCreated = computed<boolean>(() => {
	return props.value.length <= 0
		? true
		: store.getters["user/permissions"].some((item: string) => {
				return props.value.includes(item);
		  });
});
</script>
